package com.tul.vapp.servicecenter.controller;

import com.tul.vapp.servicecenter.bean.ResponseBean;
import com.tul.vapp.servicecenter.bean.ServerStatusVo;
import com.tul.vapp.servicecenter.service.IServerStatusService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * create by wujunlei
 *
 * @author wujunlei
 * @since 2018/1/5
 */
@RestController
public class ServerStatusController extends ExceptionController {

    /**
     * service
     */
    @Autowired
    private IServerStatusService service;

    /**
     * getServerStatus
     *
     * @return 服务状态
     */
    @RequestMapping(value = "/queryStaticServerInfo")
    public ResponseBean getStaticServerInfo() {
        ResponseBean bean = new ResponseBean();
        List<ServerStatusVo> data = service.getServerStatusVo();
        bean.setSuccess(true);
        bean.setData(data);
        return bean;
    }
}
